/**
 * @Auther: lichao
 * @Date: 2024/10/16 - 10 - 16 - 20:08
 * @Description: PACKAGE_NAME
 * @version: 1.0
 */

import java.util.StringJoiner;

/**
 * @program: java
 *
 * @description: StringJoiner 类下 String 方法
 *
 * @author: lichao
 *
 * @create: 2024-10-16 20:08
 **/

public class ToStringTest {
    public static void main(String[] args) {
        /**
         * toString 方法将 StringJoiner 转为字符串
         */
        StringJoiner sj = new StringJoiner(",");
        sj.add("a").add("d").add("c");
        System.out.println(sj.toString()); // a,b,c
    }
}
